using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace XDL.Framework.Particles
{
    /// <summary>
    /// Custom line trail element.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    struct LineTrailVertex
    {
        // CPU/GPU information
        public Vector3 Position;
        public Vector2 Texcoord;
        public Vector3 Direction;
        public float Lifetime;

        // map struct items to 'vertex' behaviors
        public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration
            (
                new VertexElement(0, VertexElementFormat.Vector3, VertexElementUsage.Position, 0),
                new VertexElement(12, VertexElementFormat.Vector2, VertexElementUsage.TextureCoordinate, 0),
                new VertexElement(20, VertexElementFormat.Vector3,  VertexElementUsage.Normal, 0),
                new VertexElement(32, VertexElementFormat.Single, VertexElementUsage.TextureCoordinate, 1)
            );

        /// <summary>
        /// Size in bytes.
        /// </summary>
        public const int SizeInBytes = 36;
    }
}
